package com.twu.biblioteca;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Thoughtworker
 * Date: 8/22/13
 * Time: 2:57 PM
 * To change this template use File | Settings | File Templates.
 */
public class Main {


    public static void main(String[] args) throws IOException {
        PrintStream printStream = new PrintStream(System.out);
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));

        Input input = new Input(bufferedReader);
        Output output = new Output(printStream);
        ArrayList<Book> books = new ArrayList<Book>();
        books.add(new Book("Book 1"));
        books.add(new Book("Book 2"));

        BookGetter bookGetter = new BookGetter(output, books, input);
        Movie m = new Movie("A Clockwork Orange", "1971", "Stanley Kubrick", "8");
        Movie m2 = new Movie("Monty Python and the Holy Grail", "1975", "Terry Gilliam", "N/A");
        ArrayList<Movie> movies = new ArrayList<Movie>();
        movies.add(m);
        movies.add(m2);
        MovieGetter movieGetter = new MovieGetter(movies, output);

        List<User> userList = new ArrayList<User>();
        User user = new User("Greg", "greg@dutcher.com", "911", "username", "password");
        userList.add(user);
        UserCollection userCollection = new UserCollection(userList);

        BibliotecaApp bibliotecaApp = new BibliotecaApp(bookGetter, input, output, movieGetter, userCollection);
        bibliotecaApp.start();
    }
}
